Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
What does ([, value]) => value mean ? d3.js

I'm working on d3.js, I am trying to make a stacked circles chart. I met some new stuff, like functions are defined

function myfct (xxx, {parameters}={}){ ... }

I interpreted the ", {}" part as the definition of optional parameters (? thanks for any further explanation on that)

My main question however is

chart = Pack(rollup, {
  value: ([, value]) => value,
  label: ([key]) => key?.split(/\s+/g).join("\n"),
  title: ([key], n) => `${n.depth 
    ? `${n.ancestors().reverse().slice(1).map(({data: [key]}) => key).join("\n")}\n`
    : ""}${n.value.toLocaleString("en")}`,
  width: 2000,
  height: 2000,
})

This is the code they use to call the chart function, I couldn't find someplace to understand the usage of [, value] and [key], so that I can use them for my own case ? If anyone could explain or point me where to look, would be of much help, thanks !

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!